package cn.edu.ldu.communityqa.communityqa.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;

@Data
@AllArgsConstructor
public class Msg {
    private String msg;

    public static ResponseEntity<Msg> responseEntity(String msg) {
        return ResponseEntity.ok(new Msg(msg));
    }

    public static ResponseEntity<Msg> responseEntity(String msg, int status) {
        return ResponseEntity.status(status).body(new Msg(msg));
    }

    public static ResponseEntity<Msg> responseEntity(String msg, HttpStatus status) {
        return ResponseEntity.status(status).body(new Msg(msg));
    }
}
